package scala.test_regex

import scala.util.matching.Regex

/**
 * @author 黄海峰 2021/4/19 14:31
 * */
object DeanTest {
  def main(args: Array[String]): Unit = {
    val numberPattern: Regex = "[0-9]".r
    numberPattern.findFirstMatchIn("sdhgh3sadghjasgdh") match {
      case Some(_)=>println("password ok!")
      case None=>println("password must contain a number!")
    }

  }
}
